package day06;

import java.util.Arrays;
import java.util.Comparator;

public class txt11 {
    public static void main(String[] args) {
        Integer[]a={1,2,3,4,5};


        Arrays.sort(a, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2-o1;
            }
        });
        System.out.println(Arrays.toString(a));






        String[]b={"12","233","3","455655","5279"};
        Arrays.sort(b, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return o2.length()-o1.length();
            }
        });
        System.out.println(Arrays.toString(b));



    }
}
